﻿#region Creditos

/* Autor: Edilberto Sánchez Forero	*/
/* Email: esanchezfo@gmail.com		*/
/* Licencia: Propietario			*/
/* País: Colombia, Bogotá			*/

#endregion

#region Librerias

using System.Data.Linq.Mapping;
using System.Runtime.Serialization;
using System;
using ESF.General.Entity;
using System.Collections.Generic;
using ESF.General;

#endregion


namespace ESF.SSO.Core.Entities
{
	[DataContract]
	[Serializable]
	public class Person : BaseEntity, IAuditableEntity
	{
		[DataMember]
		public int? ID { set; get; }
	
		[DataMember]
		public string FirstName { set; get; }
		
		[DataMember]
		public string SecondName { set; get; }
		
		[DataMember]
		public string SurName { set; get; }
		
		[DataMember]
		public string LastName { set; get; }
		
		[DataMember]
		public DateTime? BirthDate { set; get; }
		
		[DataMember]
		public string IdentificationNumber { set; get; }
		
		[DataMember]
		public string Email { set; get; }
		
		[DataMember]
		public BasicReference Gender { set; get; }		
		
		[DataMember]
		public BasicReference IdentificationType { set; get; }		
		
		[DataMember]
		public Enterprise Enterprise { set; get; }		
		
		[DataMember]
		public List<Location> Locations { set; get; }

		[DataMember]
		public string Position { set; get; }
		
		[DataMember]
		public string Profession { set; get; } 
		

		#region Calculados
		
		public string calFullName
		{
			get { return TextHelper.Concatenate (" ", FirstName, SecondName, SurName, LastName); }
		}
		
		#endregion


		#region ToString

		public override string ToString()
		{
			return string.Format (
				"{0} - {1} {2} - {3}", 
				calFullName, IdentificationType.Code, IdentificationNumber, Email
				);
		}

		#endregion

		public DateTime? CreationDateTime { set; get; }

		public DateTime? LastUpdateDateTime { set; get; }

		public string UserCreationAlias { set; get; }

		public string UserLastUpdateAlias { set; get; }
	}
}
